package com.zxq.demo.admin.controller;

import com.zxq.demo.admin.helper.JobHelper;
import com.zxq.demo.admin.model.ZxqJobInfo;
import com.zxq.demo.admin.service.ZxqJobService;
import com.zxq.demo.admin.utils.JobHttpUtils;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * index controller
 * @author zxq 2015-12-19 16:13:16
 */
@RestController
@RequestMapping("/jobinfo")
public class JobInfoController {

	@Resource
	private ZxqJobService zxqJobService;

	@PostMapping("/jobList")
	public List<ZxqJobInfo> jobList() {
		return zxqJobService.jobList();
	}
	@GetMapping("/triggerJob")
	public String triggerJob(@RequestParam(value = "jobId") Integer id) {
		// TODO 触发指定定时任务
		return JobHelper.triggerJobById(id);
	}
	
}
